package org.stan.beanvalidator.deletage;

/**
 * @ClassName 任务委派适配器 DeletageAdapter
 * @Author src
 * @Date 2020-07-12 10:28
 * @Discriptions
 */
public class DeletageAdapter implements IPostCodeDeletage{

    /** 统一接口规范 **/
    IPostCodeDeletage iPostCodeDeletage;

    /**
     *@Description 构造器-持有被委托人的引用
     *@Author src
     *@Date 2020-07-12 10:33
     *@Param
     *@return
     */
    public DeletageAdapter(IPostCodeDeletage iPostCodeDeletage){
        this.iPostCodeDeletage = iPostCodeDeletage;
    }

    /**
     *@Description 校验邮编
     *通过委派适配器获得的执行者引用，执行校验
     *@Author src
     *@Date 2020-07-12 10:35
     *@Param 
     *@return 
     */
    @Override
    public boolean validatePostCode(String postCode) {
        return this.iPostCodeDeletage.validatePostCode(postCode);
    }
}
